//package legorobot;
 
import lejos.nxt.*;
import lejos.nxt.comm.*;

/**
 * Command class is abstract and can be extended to create a command.
 * Each command must have an execute method that will make the robot do
 * something or behave in some way.
 * @author Daniel Van Eck
 */
public abstract class Command {
    //Name of this command.  Will be initialized by child class
    private String cmdName;
    protected static final int MOVE_FORWARD_TIME = 355;
    protected static final int MOVE_BACKWARD_TIME = 325;
    protected static final int TURN_RIGHT_TIME = 970;
    protected static final int TURN_LEFT_TIME = 965;
    protected static final int POWER = 7;
    protected static final int SPEED = 200;
    protected static final int STOPPED = 0;
    
    //LouieControl
    protected LouieControl cntrl;
    
    public Command(String n, LouieControl c) {
        cmdName = n;
        cntrl = c;
    }
    
    /*
     * Execute this Command
     */
    public abstract void execute();
    
    /*
     * Get the reverse of this command (useful for backtracking down a stack)
     */
    public abstract Command getOpposite();
    
    /*
     * Accesor to get the name of the current command
     */
    public String getName() {
        return cmdName;
    }
}
